package com.hospital.register.dto.base;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;

@ApiModel(value = "分页参数")
@Data
@ToString
public class ApiPageDto extends ApiBaseDto {

    @ApiModelProperty(value = "当前页，从 1 开始")
    @Min(value = 1, message = "页码不可小于 1")
    private int page = 1;

    @ApiModelProperty(value = "每页条数，默认 2")
    @Range(min = 1L, max = 50, message = "每页长度必须在1到50之间")
    private int limit = 2;

}
